<?php
/*
 * 
 */

class Core_StaticRegistry
	implements Interface_StaticRegistry{
	static protected $_data = null; /// use ::overwrite to change it if you want
	
	static protected function _init(){
		if( self::$_data === null )
			self::$_data = new Core_Registry( null );
	}
	
	static public function read($key = null){
		self::_init();
		
		return self::$_data->read($key);
	}
	
	static public function safeRead($key, $default = null){
		self::_init();
		
		return self::$_data->safeRead($key, $default);
	}
	
	static public function write($key, $value, $object = null){
		self::_init();
		
		return self::$_data->write($key, $value, $object);
	}
	
	static public function erase( $key , $check_first ){
		self::_init();
		
		return self::$_data->erase( $key , $check_first );
	}
	
	static public function eraseExisting( $key ){
		self::_init();

		return self::$_data->eraseExisting( $key );
	}
	
	static public function has($key){
		self::_init();
		
		return self::$_data->has($key);
	}
	
	static public function overwrite($object){
		self::_init();

		return self::$_data->overwrite($object);
	}
	
	static public function overwriteRegistry( Interface_Registry $object){
		self::$_data = $object;
	}
}